/******************************************************************************
 * Name: SPARCTraceManager.h
 * Date: 2008/12/19
 * Revision history:
 *
 * Purpose:
 *     Do the basic optimization "trace linking" on basic block, on SPARC 
 * architecture 
 *
 *****************************************************************************/

#ifndef SPARCTRACEMANAGER_H
#define SPARCTRACEMANAGER_H

#include "crossbit/TraceManager.h"

namespace crossbit
{
		class SPARCTraceManager : public TraceManager
		{
				public:
						SPARCTraceManager( MemoryManager *mm );
						virtual ~SPARCTraceManager();

						virtual void directLinkTo( TBlock* preBlock, XTInt32 exit, TBlock* block);
						virtual void indirectLinkTo( TBlock* preBlock, XTInt32 exit, TBlock* block);
						virtual void linkSuperBlock( TBlock* former_tblock , TBlock* super_tblock); 

				private:
						virtual void fillPredictionCodeBlock( TBlock* block );

						virtual XTMemAddr allocatePredictionCodeBlock();
				private:
						static const XTInt32 PREDICTIONCODEBLOCKLEN = 48;

						XTInt8 sample[PREDICTIONCODEBLOCKLEN];
		};
}
#endif	//SPARCTRACEMANAGER_H
